//
//  FangWu.m
//  Synthesize1
//
//  Created by cora1n on 14-8-5.
//  Copyright (c) 2014年 devwu. All rights reserved.
//

#import "FangWu.h"
#import "Men.h"
#import "ChuangHu.h"
@implementation FangWu
// -----------
// |    |    |
// 0    1    2
-(void)setChuangHu:(ChuangHu *)c diJiGe:(int)i
{
    if (i>=0 && i<=1) {
        _chuangHus[i] = c;
    }
    else
    {
        NSLog(@"数组越界,请进行检查后再次传入!!");
    }
}

-(ChuangHu *)chuangHuByDiJiGe:(int)i
{
    if (i>=0 && i<=1) {
        return _chuangHus[i];
    }
    else
    {
        return _chuangHus[0];
    }
}
-(void)jin
{
    NSLog(@"开门,我要进去");
    [self.men open];
    NSLog(@"进来了,关门吧!");
    [self.men close];
}
//-(void)chu
//{
//    NSLog(@"%@,开门,我要出去",self.men);
//}
-(void)huanQi
{
    for (int i = 0 ; i<2; i++) {
        NSLog(@"第%d个窗户",i+1);
        [_chuangHus[i] open];
    }
}
@end
